﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Gooddetail.aspx.cs" Inherits="ProjectX.detail" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>宝贝明细</title>
    <link type="text/css" href="WebCss/detail.css" rel="stylesheet" />	
    <link type="text/css" href="WebCss/redmond/jquery-ui.css" rel="stylesheet" />
    <script src="ClientJs/jquery.js" type="text/javascript"></script>
	<script type="text/javascript" src="ClientJs/jquery-ui.js"></script>
    <script type="text/javascript" src="ClientJs/jquery.loadthumb.js"></script>
    <script type="text/javascript" src="ClientJs/detail.js"></script>
    <script type="text/javascript">
        function collectpage() {
            $.ajax({type: "post",url: "AjaxWeb.aspx",data: { type: "collect",pid: "<%=Request["pid"].ToString()%>"},beforeSend: function (XMLHttpRequest) {},success:function(data,textStatus){if (data == "ok") {alert("收藏成功");}else if (data == "already") {alert("你已收藏过该宝贝，请在我的收藏中查看");}else {alert("收藏失败");}},complete: function (XMLHttpRequest, textStatus) {},error: function (XMLHttpRequest, textStatus, errorThrown) {}});
        }      
    </script>
</head>
<body>
    <div id="container">
        <form runat="server">
            <asp:FormView ID="myDetails" runat="server" ondatabound="myDetails_DataBound">
                <ItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <div class="CRviewer" id="CRviewer">
                                    <input id="imgsrc" type="hidden" value="<%# Eval("imgsrc").ToString().Trim() == "" ? "images\\noimg.jpg" : Eval("imgsrc")%>" />
                                    <img src="images/loading.gif" alt="" id="myImgs" />
                                </div>
                                <div class="Infomation">
                                    <table style="margin:20px;" cellpadding="0" cellspacing="0">
                                        <tr valign="top">
                                            <td>
                                                <div id="good" style="text-align:right;line-height:30px;width:80px;">
                                                    <span>宝贝</span>
                                                    <span>送给</span> 
                                                    <span>发布人</span>
                                                    <span>期望价格</span>
                                                    <span>发布日期</span>
                                                    <span>到期时间</span>
                                                    <span>宝贝产地</span>
                                                    <span>购买数量</span>
                                                    <button onclick="collectpage();">收藏</button>
                                               </div> 
                                            </td>
                                           <td>
                                                <div id="goodt" style="line-height:30px;width:170px;">
                                                    <span>&nbsp| <%# Eval("name") %></span>
                                                    <span>&nbsp| <%# Eval("Owner").ToString().Trim().Equals("0") ? "自己" : Eval("Owner").ToString().Trim().Equals("1") ? "另一半" : Eval("Owner").ToString().Trim().Equals("2") ? "父母长辈" : Eval("Owner").ToString().Trim().Equals("3") ? "好朋友" : "其他"%></span>
                                                    <span>&nbsp| <%# Eval("ReleaseName")%></span>
                                                    <span>&nbsp| <%# Eval("ExpectpricesMin")%> ~ <%# Eval("ExpectpricesMax")%></span>
                                                    <span>&nbsp| <%# Eval("Starttime", "{0:yyyy-MM-dd}")%></span>
                                                    <span>&nbsp| <%# Eval("Overtime", "{0:yyyy-MM-dd}")%></span>
                                                    <span>&nbsp| <%# Eval("Province").ToString().Trim() == "" ? "无所谓，那里都可以" : Eval("Province").ToString().Trim()+"-"+ Eval("city")%></span>
                                                    <span>&nbsp| <%# Eval("Count")%></span>
                                                </div>
                                            </td>
                                             <td>
                                                <div style="height:260px;width:230px;margin-left:20px;background:url(images/buyborder.png) no-repeat center;">  
                                                                                
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="seller" style="height:150px;overflow:auto;padding:15px;">
                                    <span style="font-size:18px;color:#1c94c4;">购买说明:</span><br />
                                    <span style="line-height:20px;"><%# Eval("Information").ToString().Trim() == "" ? "无" : Eval("Information")%></span>
                                </div>
                            </td>
                        </tr>
                        <tr>    
                            <td>
                                <div class="seller">
                                    <asp:SqlDataSource ID="sellListDatasorce" runat="server"></asp:SqlDataSource>
                                    <asp:DataList ID="SellerList" runat="server" BackColor="LightGoldenrodYellow" CellPadding="10" 
                                        DataSourceID="sellListDatasorce" ForeColor="Black" ShowFooter="False" 
                                        ShowHeader="False" Width="100%">
                                        <AlternatingItemStyle Font-Bold="False" Font-Italic="False" 
                                            Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
                                        <AlternatingItemTemplate>
                                            <div style="width:100%;text-align:right;">
                                                <span name="sellname"><%# Eval("ReleaseName")%></a>
                                            </div>
                                        </AlternatingItemTemplate>
                                        <FooterStyle BackColor="Tan" />
                                        <HeaderStyle BackColor="Tan" Font-Bold="True" />
                                        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                            Font-Strikeout="False" Font-Underline="False" Height="150px" 
                                            VerticalAlign="Bottom" Width="100%" />
                                        <ItemTemplate>
                                            <div style="width:100%;text-align:left;">
                                                <span><%# Eval("ReleaseName")%></span>
                                                <a href="<%# Eval("Tradelink") %>" target="_blank" onclick="openbuy('<%# Eval("id") %>')">去淘宝购买</a>
                                                <span>浏览数:<%# Eval("count") %></span></div>
                                        </ItemTemplate>

                                        <SeparatorStyle BorderStyle="Dashed" BorderColor="#CCCCCC" BorderWidth="1px" 
                                            Height="1px" Wrap="False" />

                                        <SeparatorTemplate>
                                            
                                        </SeparatorTemplate>

                                    </asp:DataList>
                                </div>
                            </td>
                        </tr>
                    </table>
                   
                </ItemTemplate>
            </asp:FormView>
        </form>
    </div>
    
</body>
</html>
